<%@ Language=VBSCRIPT %>
<!--#include file="functions.asp" -->
<%


  dim cn
  dim sql
  dim exRate
  dim CurSymbol
  dim rs

  
  sql="SELECT MP2CURRENCY, CURRENCYSYMBOL, EXCHANGERATE FROM EXCHRATE WHERE MP2CURRENCY ='" & request.querystring("CurrID") &"'"
  set rs=cn.execute(sql)
  
  if rs.eof then
  
%>
<SCRIPT language="JavaScript">
window.opener.<%= request.querystring("fld")%>.value='';
window.opener.<%= request.querystring("fld2")%>.value='';
//window.opener.<%= request.querystring("fld")%>.focus();
var url_source="error_msg.html";
var arg="Currency Not Found !!";
var modal_dim="dialogWidth:360px; dialogHeight:160px; center:yes; status:no; location:no;";
var x = window.showModalDialog(url_source,arg,modal_dim);
window.opener.<%= request.querystring("src")%>.focus();
window.opener.<%= request.querystring("src")%>.select();
window.close();
</SCRIPT> 
 
  <!-- html>
  <head>
  <title>Check Vendor</title></head><body bgcolor="#FFFFFF">
  <br><div align="center"><b>Vendor not found !</b><br><br>
  <input type="submit" name="Submit" value="  Close  " onClick="window.close()">
  </div>
  </body>
  </html -->

<%
  else
  Do While Not rs.EOF
  exRate=rs("EXCHANGERATE")
  curSymbol=rs("CURRENCYSYMBOL")
  rs.MoveNext
  Loop
  
  Set rs = Nothing
%>
<SCRIPT language="JavaScript">
//var querystring = '<%= request.querystring("fld")%>' ;

window.opener.<%= request.querystring("fld")%>.value='<%= exRate %>';
window.opener.<%= request.querystring("fld2")%>.value='<%= CurSymbol %>';
window.opener.<%= request.querystring("fld")%>.focus();
window.close();

</SCRIPT>
<% end if %>

